.class public Lcom/noshufou/android/su/AppListFragment$AppListAdapter;
.super Landroid/support/v4/widget/CursorAdapter;
.source "AppListFragment.java"

# interfaces
.implements Landroid/widget/AbsListView$OnScrollListener;
.implements Landroid/widget/SectionIndexer;
.implements Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderAdapter;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/noshufou/android/su/AppListFragment;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "AppListAdapter"
.end annotation


# instance fields
.field private mCursor:Landroid/database/Cursor;

.field private mDisplaySectionHeaders:Z

.field private mLastCachedPosition:I

.field private mPositions:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/Long;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private mSectionPositions:[I

.field private final mSectionTypes:[I

.field private final mSections:[Ljava/lang/String;

.field final synthetic this$0:Lcom/noshufou/android/su/AppListFragment;


# direct methods
.method public constructor <init>(Lcom/noshufou/android/su/AppListFragment;Landroid/database/Cursor;Landroid/content/Context;)V
    .locals 6
    .parameter
    .parameter "cursor"
    .parameter "context"

    .prologue
    const/4 v5, 0x2

    const/4 v4, -0x1

    const/4 v3, 0x1

    const/4 v0, 0x0

    .line 203
    iput-object p1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    .line 204
    invoke-direct {p0, p3, p2, v0}, Landroid/support/v4/widget/CursorAdapter;-><init>(Landroid/content/Context;Landroid/database/Cursor;Z)V

    .line 193
    new-array v1, v5, [Ljava/lang/String;

    const v2, 0x7f0b0019

    invoke-virtual {p1, v2}, Lcom/noshufou/android/su/AppListFragment;->getString(I)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v0

    const v2, 0x7f0b001b

    invoke-virtual {p1, v2}, Lcom/noshufou/android/su/AppListFragment;->getString(I)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v3

    iput-object v1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSections:[Ljava/lang/String;

    .line 194
    new-array v1, v5, [I

    aput v3, v1, v0

    iput-object v1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionTypes:[I

    .line 195
    new-array v1, v5, [I

    aput v4, v1, v3

    iput-object v1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionPositions:[I

    .line 197
    iput-boolean v3, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mDisplaySectionHeaders:Z

    .line 201
    iput v4, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    .line 205
    new-instance v1, Ljava/util/HashMap;

    if-eqz p2, :cond_0

    .line 206
    invoke-interface {p2}, Landroid/database/Cursor;->getCount()I

    move-result v0

    :cond_0
    invoke-direct {v1, v0}, Ljava/util/HashMap;-><init>(I)V

    .line 205
    iput-object v1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mPositions:Ljava/util/HashMap;

    .line 207
    iput v4, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    .line 208
    iput-object p2, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    .line 209
    return-void
.end method

.method private bindSectionHeader(Landroid/view/View;IZ)V
    .locals 6
    .parameter "itemView"
    .parameter "position"
    .parameter "displaySectionHeaders"

    .prologue
    const/4 v5, 0x0

    const/4 v4, 0x1

    .line 313
    move-object v2, p1

    check-cast v2, Lcom/noshufou/android/su/widget/AppListItem;

    .line 314
    .local v2, view:Lcom/noshufou/android/su/widget/AppListItem;
    if-nez p3, :cond_0

    .line 315
    invoke-virtual {v2, v5}, Lcom/noshufou/android/su/widget/AppListItem;->setSectionHeader(Ljava/lang/String;)V

    .line 316
    invoke-virtual {v2, v4}, Lcom/noshufou/android/su/widget/AppListItem;->setDividerVisible(Z)V

    .line 334
    :goto_0
    return-void

    .line 318
    :cond_0
    invoke-virtual {p0, p2}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->getSectionForPosition(I)I

    move-result v0

    .line 319
    .local v0, section:I
    invoke-virtual {p0, v0}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->getPositionForSection(I)I

    move-result v3

    if-ne v3, p2, :cond_1

    .line 320
    iget-object v3, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSections:[Ljava/lang/String;

    aget-object v1, v3, v0

    .line 321
    .local v1, title:Ljava/lang/String;
    invoke-virtual {v2, v1}, Lcom/noshufou/android/su/widget/AppListItem;->setSectionHeader(Ljava/lang/String;)V

    .line 328
    .end local v1           #title:Ljava/lang/String;
    :goto_1
    add-int/lit8 v3, v0, 0x1

    invoke-virtual {p0, v3}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->getPositionForSection(I)I

    move-result v3

    add-int/lit8 v3, v3, -0x1

    if-ne v3, p2, :cond_2

    .line 329
    invoke-virtual {v2, v4}, Lcom/noshufou/android/su/widget/AppListItem;->setDividerVisible(Z)V

    goto :goto_0

    .line 323
    :cond_1
    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lcom/noshufou/android/su/widget/AppListItem;->setDividerVisible(Z)V

    .line 324
    invoke-virtual {v2, v5}, Lcom/noshufou/android/su/widget/AppListItem;->setSectionHeader(Ljava/lang/String;)V

    goto :goto_1

    .line 331
    :cond_2
    invoke-virtual {v2, v4}, Lcom/noshufou/android/su/widget/AppListItem;->setDividerVisible(Z)V

    goto :goto_0
.end method


# virtual methods
.method public bindView(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V
    .locals 15
    .parameter "itemView"
    .parameter "context"
    .parameter "cursor"

    .prologue
    .line 262
    move-object/from16 v10, p1

    check-cast v10, Lcom/noshufou/android/su/widget/AppListItem;

    .line 264
    .local v10, view:Lcom/noshufou/android/su/widget/AppListItem;
    const/4 v11, 0x0

    move-object/from16 v0, p3

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v4

    .line 265
    .local v4, id:J
    const/4 v11, 0x1

    move-object/from16 v0, p3

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getInt(I)I

    move-result v9

    .line 266
    .local v9, uid:I
    const/4 v11, 0x2

    move-object/from16 v0, p3

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    .line 267
    .local v8, nameText:Ljava/lang/String;
    const/4 v11, 0x3

    move-object/from16 v0, p3

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    .line 270
    .local v1, allow:I
    iget-object v11, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    invoke-virtual {v11}, Lcom/noshufou/android/su/AppListFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v11

    invoke-static {v11, v9}, Lcom/noshufou/android/su/util/Util;->getAppIcon(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object v11

    invoke-virtual {v10, v11}, Lcom/noshufou/android/su/widget/AppListItem;->setAppIcon(Landroid/graphics/drawable/Drawable;)V

    .line 273
    if-eqz v8, :cond_0

    invoke-virtual {v8}, Ljava/lang/String;->length()I

    move-result v11

    if-lez v11, :cond_0

    .line 274
    invoke-virtual {v10, v8}, Lcom/noshufou/android/su/widget/AppListItem;->setNameText(Ljava/lang/CharSequence;)V

    .line 280
    :goto_0
    iget-object v11, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    #getter for: Lcom/noshufou/android/su/AppListFragment;->mShowStatusIcons:Z
    invoke-static {v11}, Lcom/noshufou/android/su/AppListFragment;->access$1(Lcom/noshufou/android/su/AppListFragment;)Z

    move-result v11

    if-eqz v11, :cond_1

    .line 281
    iget-object v11, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    invoke-virtual {v11}, Lcom/noshufou/android/su/AppListFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v11

    invoke-static {v11, v1}, Lcom/noshufou/android/su/util/Util;->getStatusIconDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object v11

    const/4 v12, 0x0

    const-wide/16 v13, 0x0

    invoke-virtual {v10, v11, v12, v13, v14}, Lcom/noshufou/android/su/widget/AppListItem;->setStatusButton(Landroid/graphics/drawable/Drawable;IJ)V

    .line 295
    :goto_1
    const/4 v11, 0x4

    move-object/from16 v0, p3

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v2

    .line 296
    .local v2, date:J
    iget-object v11, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    #getter for: Lcom/noshufou/android/su/AppListFragment;->mShowLogData:Z
    invoke-static {v11}, Lcom/noshufou/android/su/AppListFragment;->access$2(Lcom/noshufou/android/su/AppListFragment;)Z

    move-result v11

    if-eqz v11, :cond_2

    const-wide/16 v11, 0x0

    cmp-long v11, v2, v11

    if-lez v11, :cond_2

    .line 297
    const/4 v11, 0x5

    move-object/from16 v0, p3

    invoke-interface {v0, v11}, Landroid/database/Cursor;->getInt(I)I

    move-result v6

    .line 298
    .local v6, lastLogType:I
    const v7, 0x7f0b0028

    .line 299
    .local v7, logTextRes:I
    packed-switch v6, :pswitch_data_0

    .line 305
    :goto_2
    iget-object v11, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    const/4 v12, 0x2

    new-array v12, v12, [Ljava/lang/Object;

    const/4 v13, 0x0

    iget-object v14, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    invoke-virtual {v14}, Lcom/noshufou/android/su/AppListFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v14

    invoke-static {v14, v2, v3}, Lcom/noshufou/android/su/util/Util;->formatDate(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v14

    aput-object v14, v12, v13

    const/4 v13, 0x1

    .line 306
    iget-object v14, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    invoke-virtual {v14}, Lcom/noshufou/android/su/AppListFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v14

    invoke-static {v14, v2, v3}, Lcom/noshufou/android/su/util/Util;->formatTime(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v14

    aput-object v14, v12, v13

    .line 305
    invoke-virtual {v11, v7, v12}, Lcom/noshufou/android/su/AppListFragment;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Lcom/noshufou/android/su/widget/AppListItem;->setLogText(Ljava/lang/CharSequence;)V

    .line 310
    .end local v6           #lastLogType:I
    .end local v7           #logTextRes:I
    :goto_3
    return-void

    .line 276
    .end local v2           #date:J
    :cond_0
    iget-object v11, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    const v12, 0x7f0b0020

    invoke-virtual {v11, v12}, Lcom/noshufou/android/su/AppListFragment;->getString(I)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Lcom/noshufou/android/su/widget/AppListItem;->setNameText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 291
    :cond_1
    const/4 v11, 0x0

    const/4 v12, 0x0

    const-wide/16 v13, 0x0

    invoke-virtual {v10, v11, v12, v13, v14}, Lcom/noshufou/android/su/widget/AppListItem;->setStatusButton(Landroid/graphics/drawable/Drawable;IJ)V

    goto :goto_1

    .line 300
    .restart local v2       #date:J
    .restart local v6       #lastLogType:I
    .restart local v7       #logTextRes:I
    :pswitch_0
    const v7, 0x7f0b0029

    goto :goto_2

    .line 301
    :pswitch_1
    const v7, 0x7f0b002a

    goto :goto_2

    .line 302
    :pswitch_2
    const v7, 0x7f0b002b

    goto :goto_2

    .line 303
    :pswitch_3
    const v7, 0x7f0b002c

    goto :goto_2

    .line 308
    .end local v6           #lastLogType:I
    .end local v7           #logTextRes:I
    :cond_2
    const/4 v11, 0x0

    invoke-virtual {v10, v11}, Lcom/noshufou/android/su/widget/AppListItem;->setLogText(Ljava/lang/CharSequence;)V

    goto :goto_3

    .line 299
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
        :pswitch_3
        :pswitch_2
    .end packed-switch
.end method

.method public configurePinnedHeader(Landroid/view/View;II)V
    .locals 11
    .parameter "header"
    .parameter "position"
    .parameter "alpha"

    .prologue
    .line 390
    invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;

    .line 391
    .local v1, cache:Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;
    if-nez v1, :cond_0

    .line 392
    new-instance v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;

    .end local v1           #cache:Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;
    invoke-direct {v1}, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;-><init>()V

    .line 393
    .restart local v1       #cache:Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;
    const v7, 0x7f0a0037

    invoke-virtual {p1, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/TextView;

    iput-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->titleView:Landroid/widget/TextView;

    .line 394
    iget-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->titleView:Landroid/widget/TextView;

    invoke-virtual {v7}, Landroid/widget/TextView;->getTextColors()Landroid/content/res/ColorStateList;

    move-result-object v7

    iput-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->textColor:Landroid/content/res/ColorStateList;

    .line 395
    invoke-virtual {p1}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object v7

    iput-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->background:Landroid/graphics/drawable/Drawable;

    .line 396
    invoke-virtual {p1, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 399
    :cond_0
    invoke-virtual {p0, p2}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->getSectionForPosition(I)I

    move-result v4

    .line 401
    .local v4, section:I
    iget-object v7, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSections:[Ljava/lang/String;

    aget-object v6, v7, v4

    .line 402
    .local v6, title:Ljava/lang/String;
    iget-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->titleView:Landroid/widget/TextView;

    invoke-virtual {v7, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 404
    const/16 v7, 0xff

    if-ne p3, v7, :cond_1

    .line 406
    iget-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->background:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p1, v7}, Landroid/view/View;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 407
    iget-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->titleView:Landroid/widget/TextView;

    iget-object v8, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->textColor:Landroid/content/res/ColorStateList;

    invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(Landroid/content/res/ColorStateList;)V

    .line 424
    :goto_0
    return-void

    .line 411
    :cond_1
    iget-object v7, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    #getter for: Lcom/noshufou/android/su/AppListFragment;->mPinnedHeaderBackgroundColor:I
    invoke-static {v7}, Lcom/noshufou/android/su/AppListFragment;->access$3(Lcom/noshufou/android/su/AppListFragment;)I

    move-result v7

    invoke-static {v7}, Landroid/graphics/Color;->red(I)I

    move-result v3

    .line 412
    .local v3, red:I
    iget-object v7, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    #getter for: Lcom/noshufou/android/su/AppListFragment;->mPinnedHeaderBackgroundColor:I
    invoke-static {v7}, Lcom/noshufou/android/su/AppListFragment;->access$3(Lcom/noshufou/android/su/AppListFragment;)I

    move-result v7

    invoke-static {v7}, Landroid/graphics/Color;->green(I)I

    move-result v2

    .line 413
    .local v2, green:I
    iget-object v7, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    #getter for: Lcom/noshufou/android/su/AppListFragment;->mPinnedHeaderBackgroundColor:I
    invoke-static {v7}, Lcom/noshufou/android/su/AppListFragment;->access$3(Lcom/noshufou/android/su/AppListFragment;)I

    move-result v7

    invoke-static {v7}, Landroid/graphics/Color;->blue(I)I

    move-result v0

    .line 416
    .local v0, blue:I
    rsub-int v7, v3, 0xff

    mul-int/2addr v7, p3

    div-int/lit16 v7, v7, 0xff

    rsub-int v7, v7, 0xff

    .line 417
    rsub-int v8, v2, 0xff

    mul-int/2addr v8, p3

    div-int/lit16 v8, v8, 0xff

    rsub-int v8, v8, 0xff

    .line 418
    rsub-int v9, v0, 0xff

    mul-int/2addr v9, p3

    div-int/lit16 v9, v9, 0xff

    rsub-int v9, v9, 0xff

    .line 415
    invoke-static {v7, v8, v9}, Landroid/graphics/Color;->rgb(III)I

    move-result v7

    invoke-virtual {p1, v7}, Landroid/view/View;->setBackgroundColor(I)V

    .line 420
    iget-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->textColor:Landroid/content/res/ColorStateList;

    invoke-virtual {v7}, Landroid/content/res/ColorStateList;->getDefaultColor()I

    move-result v5

    .line 421
    .local v5, textColor:I
    iget-object v7, v1, Lcom/noshufou/android/su/widget/PinnedHeaderListView$PinnedHeaderCache;->titleView:Landroid/widget/TextView;

    .line 422
    invoke-static {v5}, Landroid/graphics/Color;->red(I)I

    move-result v8

    invoke-static {v5}, Landroid/graphics/Color;->green(I)I

    move-result v9

    invoke-static {v5}, Landroid/graphics/Color;->blue(I)I

    move-result v10

    .line 421
    invoke-static {p3, v8, v9, v10}, Landroid/graphics/Color;->argb(IIII)I

    move-result v8

    invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V

    goto :goto_0
.end method

.method public getDisplaySectionHeadersEnabled()Z
    .locals 1

    .prologue
    .line 222
    iget-boolean v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mDisplaySectionHeaders:Z

    return v0
.end method

.method public getPinnedHeaderState(I)I
    .locals 4
    .parameter "position"

    .prologue
    const/4 v2, 0x0

    .line 428
    iget-object v3, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    if-eqz v3, :cond_0

    iget-object v3, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    invoke-interface {v3}, Landroid/database/Cursor;->getCount()I

    move-result v3

    if-eqz v3, :cond_0

    iget-object v3, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    invoke-interface {v3}, Landroid/database/Cursor;->isClosed()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 444
    :cond_0
    :goto_0
    return v2

    .line 432
    :cond_1
    if-ltz p1, :cond_0

    .line 438
    invoke-virtual {p0, p1}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->getSectionForPosition(I)I

    move-result v1

    .line 439
    .local v1, section:I
    add-int/lit8 v2, v1, 0x1

    invoke-virtual {p0, v2}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->getPositionForSection(I)I

    move-result v0

    .line 440
    .local v0, nextSectionPosition:I
    const/4 v2, -0x1

    if-eq v0, v2, :cond_2

    add-int/lit8 v2, v0, -0x1

    if-ne p1, v2, :cond_2

    .line 441
    const/4 v2, 0x2

    goto :goto_0

    .line 444
    :cond_2
    const/4 v2, 0x1

    goto :goto_0
.end method

.method public getPositionForId(J)I
    .locals 3
    .parameter "id"

    .prologue
    .line 231
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mPositions:Ljava/util/HashMap;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 232
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mPositions:Ljava/util/HashMap;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    .line 243
    :goto_0
    return v0

    .line 234
    :cond_0
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    iget v1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    invoke-interface {v0, v1}, Landroid/database/Cursor;->moveToPosition(I)Z

    .line 235
    :cond_1
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v0

    if-nez v0, :cond_2

    .line 243
    const/4 v0, -0x1

    goto :goto_0

    .line 236
    :cond_2
    iget v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    .line 237
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v0

    cmp-long v0, v0, p1

    if-nez v0, :cond_1

    .line 238
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mPositions:Ljava/util/HashMap;

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    iget v2, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 239
    iget v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    goto :goto_0
.end method

.method public getPositionForSection(I)I
    .locals 8
    .parameter "sectionIndex"

    .prologue
    const/4 v2, 0x0

    .line 338
    const/4 v0, 0x1

    if-le p1, v0, :cond_0

    .line 339
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v7

    .line 354
    :goto_0
    return v7

    .line 341
    :cond_0
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionPositions:[I

    aget v0, v0, p1

    const/4 v3, -0x1

    if-le v0, v3, :cond_1

    .line 342
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionPositions:[I

    aget v7, v0, p1

    goto :goto_0

    .line 344
    :cond_1
    sget-object v0, Lcom/noshufou/android/su/provider/PermissionsProvider$Apps;->COUNT_CONTENT_URI:Landroid/net/Uri;

    iget-object v3, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionTypes:[I

    add-int/lit8 v4, p1, -0x1

    aget v3, v3, v4

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-static {v0, v3}, Landroid/net/Uri;->withAppendedPath(Landroid/net/Uri;Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    .line 345
    .local v1, uri:Landroid/net/Uri;
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->this$0:Lcom/noshufou/android/su/AppListFragment;

    invoke-virtual {v0}, Lcom/noshufou/android/su/AppListFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/v4/app/FragmentActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    move-object v3, v2

    move-object v4, v2

    move-object v5, v2

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 346
    .local v6, c:Landroid/database/Cursor;
    const/4 v7, 0x0

    .line 347
    .local v7, numInSection:I
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 348
    const/4 v0, 0x0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v7

    .line 352
    :goto_1
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 353
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionPositions:[I

    aput v7, v0, p1

    goto :goto_0

    .line 350
    :cond_2
    const/4 v7, 0x0

    goto :goto_1
.end method

.method public getSectionForPosition(I)I
    .locals 4
    .parameter "position"

    .prologue
    const/4 v1, 0x1

    .line 360
    iget-object v2, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    if-nez v2, :cond_1

    .line 361
    const/4 v1, -0x1

    .line 368
    :cond_0
    :goto_0
    return v1

    .line 363
    :cond_1
    iget-object v2, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    invoke-interface {v2, p1}, Landroid/database/Cursor;->moveToPosition(I)Z

    .line 364
    iget-object v2, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    const/4 v3, 0x3

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    .line 365
    .local v0, allow:I
    if-ne v0, v1, :cond_0

    .line 366
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public getSections()[Ljava/lang/Object;
    .locals 1

    .prologue
    .line 374
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSections:[Ljava/lang/String;

    return-object v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 2
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 248
    invoke-super {p0, p1, p2, p3}, Landroid/support/v4/widget/CursorAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 249
    .local v0, v:Landroid/view/View;
    const/4 v1, 0x1

    invoke-direct {p0, v0, p1, v1}, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->bindSectionHeader(Landroid/view/View;IZ)V

    .line 250
    return-object v0
.end method

.method public hasStableIds()Z
    .locals 1

    .prologue
    .line 227
    const/4 v0, 0x1

    return v0
.end method

.method public newView(Landroid/content/Context;Landroid/database/Cursor;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 2
    .parameter "context"
    .parameter "cursor"
    .parameter "parent"

    .prologue
    .line 255
    new-instance v0, Lcom/noshufou/android/su/widget/AppListItem;

    const/4 v1, 0x0

    invoke-direct {v0, p1, v1}, Lcom/noshufou/android/su/widget/AppListItem;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 257
    .local v0, view:Lcom/noshufou/android/su/widget/AppListItem;
    return-object v0
.end method

.method public onScroll(Landroid/widget/AbsListView;III)V
    .locals 1
    .parameter "view"
    .parameter "firstVisibleItem"
    .parameter "visibleItemCount"
    .parameter "totalItemCount"

    .prologue
    .line 379
    instance-of v0, p1, Lcom/noshufou/android/su/widget/PinnedHeaderListView;

    if-eqz v0, :cond_0

    if-lez p3, :cond_0

    .line 380
    check-cast p1, Lcom/noshufou/android/su/widget/PinnedHeaderListView;

    .end local p1
    invoke-virtual {p1, p2}, Lcom/noshufou/android/su/widget/PinnedHeaderListView;->configureHeaderView(I)V

    .line 382
    :cond_0
    return-void
.end method

.method public onScrollStateChanged(Landroid/widget/AbsListView;I)V
    .locals 0
    .parameter "view"
    .parameter "scrollState"

    .prologue
    .line 386
    return-void
.end method

.method public swapCursor(Landroid/database/Cursor;)Landroid/database/Cursor;
    .locals 3
    .parameter "newCursor"

    .prologue
    const/4 v2, -0x1

    .line 213
    iget-object v0, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mSectionPositions:[I

    const/4 v1, 0x1

    aput v2, v0, v1

    .line 214
    iput-object p1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mCursor:Landroid/database/Cursor;

    .line 215
    new-instance v1, Ljava/util/HashMap;

    if-eqz p1, :cond_0

    .line 216
    invoke-interface {p1}, Landroid/database/Cursor;->getCount()I

    move-result v0

    :goto_0
    invoke-direct {v1, v0}, Ljava/util/HashMap;-><init>(I)V

    .line 215
    iput-object v1, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mPositions:Ljava/util/HashMap;

    .line 217
    iput v2, p0, Lcom/noshufou/android/su/AppListFragment$AppListAdapter;->mLastCachedPosition:I

    .line 218
    invoke-super {p0, p1}, Landroid/support/v4/widget/CursorAdapter;->swapCursor(Landroid/database/Cursor;)Landroid/database/Cursor;

    move-result-object v0

    return-object v0

    .line 216
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
